<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 引入 ElementUI 样式 -->
    <link rel="stylesheet" href="../element-ui/lib/theme-chalk/index.css" />
    <script src="../js/vue.js"></script>
    <!-- 引入 ElementUI 组件库 -->
    <script src="../js/index.js"></script>
  </head>
  <body>
    <div id="app">
      <el-button :plain="true" @click="open1">消息</el-button>
      <el-button :plain="true" @click="open2">成功</el-button>
      <el-button :plain="true" @click="open3">警告</el-button>
      <el-button :plain="true" @click="open4">错误</el-button>
    </div>
    <script>
      new Vue({
        el: "#app",
        // 定义 VUE 对象的方法
        methods: {
          open1() {
            this.$message("这是一条消息提示");
          },
          open2() {
            this.$message({
              message: "恭喜你，这是一条成功消息",
              type: "success",
            });
          },
          open3() {
            this.$message({
              message: "警告哦，这是一条警告消息",
              type: "warning",
            });
          },
          open4() {
            this.$message.error("错了哦，这是一条错误消息");
          },
        },
      });
    </script>
  </body>
</html>
